<template>
	<div style="color: gray;text-align: left;">
		首页/上传课程
	</div>
	<el-table class="table" :data="tableData" stripe style="width: 100%;margin-top: 25px;">
		<el-table-column prop="class_name" label="班级">
		</el-table-column>

		<el-table-column prop="count" label="认证课程数">
		</el-table-column>

		<el-table-column prop="class_id" label="选择">
			<template v-slot="scope">
				<el-button style="background-color: green; color: white;" @click="handlePassClick(scope.row.class_id)">
					认证课程
				</el-button>
			</template>
		</el-table-column>


	</el-table>



</template>

<script>
	// import { kebabCase } from 'element-plus/es/utils'
	import axios from "axios"
	export default {
		data() {
			return {
				tableData: [],
			}
		},
		mounted() {
			const that = this
			const url = this.$API_URL + '/teacher/getAllClass';
			axios.get(url, {
					params: {
						teacher_id: 1
					}
				}, {
					headers: {
						'Content-Type': 'application/json'
					}
				})
				.then(response => {
					var temp = response.data;
					that.tableData = temp;
				})
		},
		methods: {
			handlePassClick(classId) {
			  this.$router.push({
			    path: '/details',
			    query: { classId: classId }
			  });
			}
		},
		watch: {

		},
	}
</script>

<style lang="scss">
	.controls {
		display: flex;
		flex-direction: row;
		margin-left: 900px;
		padding: 20rpx 30rpx;

		.date-container {
			width: 80%;
		}
	}
</style>